﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class UnityEngineTextCoreLowLevelFontEngineWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(UnityEngine.TextCore.LowLevel.FontEngine);
			Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
			
			
			
			
			
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 12, 0, 0);
			Utils.RegisterFunc(L, Utils.CLS_IDX, "InitializeFontEngine", _m_InitializeFontEngine_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "DestroyFontEngine", _m_DestroyFontEngine_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadFontFace", _m_LoadFontFace_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "UnloadFontFace", _m_UnloadFontFace_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "UnloadAllFontFaces", _m_UnloadAllFontFaces_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "SetFaceSize", _m_SetFaceSize_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetFaceInfo", _m_GetFaceInfo_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetFontFaces", _m_GetFontFaces_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "TryGetGlyphIndex", _m_TryGetGlyphIndex_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "TryGetGlyphWithUnicodeValue", _m_TryGetGlyphWithUnicodeValue_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "TryGetGlyphWithIndexValue", _m_TryGetGlyphWithIndexValue_xlua_st_);
            
			
            
			
			
			
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            return LuaAPI.luaL_error(L, "UnityEngine.TextCore.LowLevel.FontEngine does not have a constructor!");
        }
        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_InitializeFontEngine_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.InitializeFontEngine(  );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_DestroyFontEngine_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.DestroyFontEngine(  );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_LoadFontFace_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)) 
                {
                    string _filePath = LuaAPI.lua_tostring(L, 1);
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace( _filePath );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)) 
                {
                    byte[] _sourceFontFile = LuaAPI.lua_tobytes(L, 1);
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace( _sourceFontFile );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 1&& translator.Assignable<UnityEngine.Font>(L, 1)) 
                {
                    UnityEngine.Font _font = (UnityEngine.Font)translator.GetObject(L, 1, typeof(UnityEngine.Font));
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace( _font );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) 
                {
                    string _filePath = LuaAPI.lua_tostring(L, 1);
                    int _pointSize = LuaAPI.xlua_tointeger(L, 2);
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace( _filePath, _pointSize );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) 
                {
                    byte[] _sourceFontFile = LuaAPI.lua_tobytes(L, 1);
                    int _pointSize = LuaAPI.xlua_tointeger(L, 2);
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace( _sourceFontFile, _pointSize );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.Font>(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) 
                {
                    UnityEngine.Font _font = (UnityEngine.Font)translator.GetObject(L, 1, typeof(UnityEngine.Font));
                    int _pointSize = LuaAPI.xlua_tointeger(L, 2);
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace( _font, _pointSize );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) 
                {
                    string _filePath = LuaAPI.lua_tostring(L, 1);
                    int _pointSize = LuaAPI.xlua_tointeger(L, 2);
                    int _faceIndex = LuaAPI.xlua_tointeger(L, 3);
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace( _filePath, _pointSize, _faceIndex );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) 
                {
                    byte[] _sourceFontFile = LuaAPI.lua_tobytes(L, 1);
                    int _pointSize = LuaAPI.xlua_tointeger(L, 2);
                    int _faceIndex = LuaAPI.xlua_tointeger(L, 3);
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace( _sourceFontFile, _pointSize, _faceIndex );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 3&& translator.Assignable<UnityEngine.Font>(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) 
                {
                    UnityEngine.Font _font = (UnityEngine.Font)translator.GetObject(L, 1, typeof(UnityEngine.Font));
                    int _pointSize = LuaAPI.xlua_tointeger(L, 2);
                    int _faceIndex = LuaAPI.xlua_tointeger(L, 3);
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace( _font, _pointSize, _faceIndex );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.TextCore.LowLevel.FontEngine.LoadFontFace!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_UnloadFontFace_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.UnloadFontFace(  );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_UnloadAllFontFaces_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.UnloadAllFontFaces(  );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_SetFaceSize_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    int _pointSize = LuaAPI.xlua_tointeger(L, 1);
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.SetFaceSize( _pointSize );
                        translator.PushUnityEngineTextCoreLowLevelFontEngineError(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetFaceInfo_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.GetFaceInfo(  );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetFontFaces_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.GetFontFaces(  );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_TryGetGlyphIndex_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    uint _unicode = LuaAPI.xlua_touint(L, 1);
                    uint _glyphIndex;
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.TryGetGlyphIndex( _unicode, out _glyphIndex );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    LuaAPI.xlua_pushuint(L, _glyphIndex);
                        
                    
                    
                    
                    return 2;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_TryGetGlyphWithUnicodeValue_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    uint _unicode = LuaAPI.xlua_touint(L, 1);
                    UnityEngine.TextCore.LowLevel.GlyphLoadFlags _flags;translator.Get(L, 2, out _flags);
                    UnityEngine.TextCore.Glyph _glyph;
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.TryGetGlyphWithUnicodeValue( _unicode, _flags, out _glyph );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    translator.Push(L, _glyph);
                        
                    
                    
                    
                    return 2;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_TryGetGlyphWithIndexValue_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    uint _glyphIndex = LuaAPI.xlua_touint(L, 1);
                    UnityEngine.TextCore.LowLevel.GlyphLoadFlags _flags;translator.Get(L, 2, out _flags);
                    UnityEngine.TextCore.Glyph _glyph;
                    
                        var gen_ret = UnityEngine.TextCore.LowLevel.FontEngine.TryGetGlyphWithIndexValue( _glyphIndex, _flags, out _glyph );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    translator.Push(L, _glyph);
                        
                    
                    
                    
                    return 2;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        
        
        
        
        
		
		
		
		
    }
}
